CPSC 330 Lecture 23: Deployment and conclusion

Varada Kolhatkar

Focus on the breath!

Announcements

  • Last lecture today 🥺!
  • HW9 is due Friday, Dec 5th at 11:59 PM (No late submission allowed.)
  • My OH next week has been moved to 11 AM. Do you prefer in-person or Zoom OH?
  • For an in-person OH I’ll book a larger room.

❓❓ Questions for you

Imagine you’ve created a machine learning model and are eager to share it with others. Consider the following scenarios for sharing your model:

  • To a non-technical Audience: How would you present your model to friends and family who may not have a technical background?
  • To a technical audience: How would you share your model with peers or professionals in the field who have a technical understanding of machine learning?
  • In an academic or research setting: How would you disseminate your model within academic or research communities?

Try out this moment predictor

https://cpsc330-moment-predictor.onrender.com/

  • In this lecture, I will show you how to set up/develop this.

What is deployment?

  • After we train a model, we want to use it!
  • The user likely does not want to install your Python stack, train your model.
  • You don’t necessarily want to share the dataset.
  • So we need to do two things:
    1. Save/store your model for later use.
    2. Make the saved model conveniently accessible.

We will use the tools below for

  • Saving the model: We will use Joblib
  • Making the saved model conveniently accessible: Flask & render

Class demo

Course evaluations (~15 mins)

https://canvas.ubc.ca/courses/170662/external_tools/53187

  • They help us improve our teaching!
  • UBC & CS uses them to provide rewards to instructors and TAs who are doing well!
  • UBC & CS uses them to identify where instructors, TAs and courses need additional supports to improve.
  • UBC uses these in evaluating professors for tenure and promotion.
  • I’ll very much appreciate your constructive and concrete feedback.

What did we cover

  • Part 1: Supervised learning on tabular data: ML fundamentals, preprocessing and data encoding, a bunch of models, evaluation metrics, feature importances and model transparency, feature selection, hyperparameter optimization

  • Part 2: Dealing with other non-tabular data types: Clustering, recommender systems, computer vision with pre-trained deep learning models (high level), language data, text preprocessing, embeddings, topic modeling, time series, right-censored data / survival analysis

  • Part 3: Communication, Ethics, and Deployment

What we didn’t cover

  • How do these models work under the hood

What next?

If you want to further develop your machine learning skills:

  • Practice!

  • Work on your own projects. Make your work available and reproducible.

  • If you are interested in research in machine learning

    • Take CPSC 340. If you do not have the required prereqs you can try to audit it.
    • Get into the habit of reading papers and replicating results

❓❓ Questions for you

For each of the scenarios below identify whether ML is a good solution for the problem. If yes

  • Frame the task as a machine learning problem (classification, regression, clustering, forecasting, survival analysis, recommendation, etc.).
  • Identify key features you would need to solve the problem effectively.
  • Propose a reasonable baseline model or heuristic to compare against.
  • Choose an appropriate ML model for the scenario and explain why it’s suitable.
  • Specify success metrics that make sense for the task.

❓❓ Questions for you

App Goal
QueuePredictor app Inform callers how long they will wait on hold given the current call volume.
To-doList App Keep track of tasks a user enters and organize them by date.
SegmentSphere App Segment customers to tailor marketing strategies based on purchasing behaviour.
Video app Recommend useful or personalized videos to users.
Dining app Identify the cuisine type from a restaurant’s menu.
Weather app Estimate precipitation amounts in 6-hour increments for a geographic region.
EvoCarShare app Predict the number of car rentals in 4-hour increments at a particular Evo parking spot.
Pharma app Understand the effect of a new drug on patient survival time.

Conclusion & farewell

That’s all! We made it! I hope you learned something useful from the course. You all are wonderful students and I had fun teaching this course ♥️!

If you didn’t fill out course evaluations during class , it’ll be great if you can fill them in when you get a chance.